#include <iostream>
using namespace std;

int month_day[13] = {-1,31,28,31,30,31,30,31,31,30,31,30,31};

bool isLeapYear(int year){
    return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
}

int daysFromYearStart(int year, int month, int day){
    int days = 0;
    for(int y = 0; y < year; y++){
        days += isLeapYear(y) ? 366 : 365;
    }
    for(int m = 1; m < month; m++){
        if(m == 2 && isLeapYear(year)) days += 29;
        else days += month_day[m];
    }
    days += day;
    return days;
}

int main(){
    int in1, in2;
    cin >> in1 >> in2;
    if(in1 == in2) {
        std::cout << 0 << std::endl;
        return 0;
    }
    
    int year1 = in1 / 10000, month1 = (in1 / 100) % 100, day1 = in1 % 100;
    int year2 = in2 / 10000, month2 = (in2 / 100) % 100, day2 = in2 % 100;

    int diff = daysFromYearStart(year2, month2, day2) - daysFromYearStart(year1, month1, day1);
    diff = diff < 0 ? -(diff + 1) : diff + 1;
    cout << diff << endl;
    return 0;
}
